import { without } from "lodash-es";
import { CommonComponentProps, CommonEditForm, PropToForm } from "./types";
import { commonDefaultProps, commonDefaultEdit } from "./constants";

export interface IImageComponentProps extends CommonComponentProps {
    src: string;
}

export interface IImageEditProps extends CommonEditForm {
    src: PropToForm,
}

export const defaultImageComponentProps: IImageComponentProps = {
    src: "",
    ...commonDefaultProps
}

export const defaultImageEditProps: IImageEditProps = {
    src: {
        tag: "VImageProcess",
        type: "basic",
        propType: "component",
    },
    ...commonDefaultEdit
}

export const defaultImageTemplate = [
    {   
        src: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fpic1.win4000.com%2Fwallpaper%2F2020-07-02%2F5efd4bc99ff67.jpg&refer=http%3A%2F%2Fpic1.win4000.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1625371837&t=cc46c88f09276ca5a91f65f0ebf9c17a",
        width: "120px",
        height: "auto"
    },
    {
        src: "https://gimg2.baidu.com/image_search/src=http%3A%2F%2Fimage.biaobaiju.com%2Fuploads%2F20180802%2F01%2F1533144475-fEAGSqluiI.jpg&refer=http%3A%2F%2Fimage.biaobaiju.com&app=2002&size=f9999,10000&q=a80&n=0&g=0n&fmt=jpeg?sec=1625372469&t=ff9feed0af8cbfe0409a81ab9e82c16a",
        width: "120px",
        height: "auto"
    }
]

export const imageStylePropsNames = without(Object.keys(defaultImageComponentProps), "src");